home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 3⁄23⁄90 / 0970-TTEViews in Dialogs-Mar90 < prev    next >
Encoding:
Text File  |  1990-03-23  |  1.6 KB  |  46 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  MACAPP.ADMIN to NORVELL.J
  2.  
  3. Item    2533895                         23-March-90        10:04PST
  4.  
  5. From:   WILSON6                         Wilson, Dave-Personal Concepts,VCA
  6.  
  7. To:     D5284                           BDM Int'l, Ann Confer,PRT
  8.         DAWSON.M                        Dawson, Mark
  9.  
  10. cc:     MACAPP.TECH$                    MacApp Technical
  11.  
  12. Sub:    TTEViews in Dialogs
  13.  
  14. There have been a couple of questions lately about using TTEViews in a dialog.
  15. My experience has been that an enclosing TDialogView will use the Tab key to
  16. move the user from one TEditText to another, but will not activate a TTEView.
  17. In fact, if you used the new unsupported TTabTEView in MacApp 2.0 final, then
  18. you probably want a TTEView to accept the tab chatacters, rather than switch
  19. you to another view.
  20.  
  21. To activate the TEView, you need to make it the target view, so it gets DoIdle
  22. and DoKeyCommand messages. I think you want a mouse click to be the mechanism
  23. to activate the text paragraph, so you should subclass TTEView and override
  24. DoMouseCommand. Without testing ,the code might be:
  25.  
  26. {$S ASelCommand}
  27. FUNCTION  TMyTEView.DoMouseCommand(VAR theMouse: Point;
  28.    VAR info: EventInfo; VAR hysteresis: Point): TCommand; OVERRIDE;
  29. BEGIN
  30.     IF gTarget = SELF THEN
  31.         DoMouseCommand := INHERITED DoMouseCommand(theMouse, info, hysteresis)
  32.     ELSE BEGIN
  33.         SELF.GetWindow.SetTarget(SELF);
  34.         DoMouseCommand := gNoChanges;       {can use NIL with 2.0 final}
  35.         END;    {ELSE}
  36. END;
  37.  
  38. Remember to make instances of this new subclass when using ViewEdit.
  39.  
  40. If you try this, let me know if it works.
  41.  
  42. Thanks,
  43.  
  44. Dave
  45.  
  46.